package graphics.raytracing;
import static util.MatrixOperationsF.cloo;
import graphics.datastructures.Model;
public class CastResult<T extends Tracable<?>> {
	private T _tr;
	private float[] _hit;
	private float[] _normal;
	private float _distance;
	private Model<T> _model;
	/**
	 * The object that was hit & the location it was hit at
	 * @param tr
	 * @param hit
	 * @param normal 
	 */
	public CastResult(T tr,float[] hit, float[] normal,float distance)
	{
		_tr=tr;
		_hit=cloo(hit);
		_normal=cloo(normal);
		_distance=distance;
	}
	public T getTracable()
	{
		return _tr;
	}
	public float[] getLocation(){
		return _hit;
	}
	/**
	 * Interpolated normal on the surface, depends on where you hit.
	 */
	public float[] getNormal() {
		return _normal;
	}
	public float distance() {
		return _distance;
	}
	public void setModel(Model model)
	{
		_model=model;
	}
	public Model getModel() {
		return _model;
		
	}
}
